<template>
  <div id="app">
    <div class="top">
      <van-nav-bar
        title="洗护详情"
        left-arrow
        :border="false"
        @click-left="$router.go(-1)" />
    </div>
    <div class="cont">
      <img v-lazy="num.imgname" alt="" />
      <div class="price">
        <!-- <span>价格:</span> -->

        <span>￥{{ num.price }}</span>
      </div>
      <div class="title">
        {{ num.title }}
      </div>
      <div class="xian"></div>
      <div class="xm">
        <p>包含项目：</p>
        <p>{{ num.label }}</p>
      </div>
      <div class="xian"></div>

      <div class="xm">
        <p>服务对象：</p>
        <span class="sp">犬</span>
        <span class="sp">猫</span>
        <span class="sp">兔</span>
        <span class="sp">禽</span>
      </div>
      <div class="xian"></div>
      <div class="xm">
        <p>宠物美容师</p>
        <img
          class="img2"
          src="@/assets/f3e088ebd1aac0819e44a21cbe2db20.jpg"
          alt="" />
        <div class="cy">从业10年</div>
      </div>
    </div>
  </div>
</template>

<script>
import { getWash } from '@/api/home'
export default {
  data() {
    return {
      img: [],
      loading: true,
      wid: this.$route.params.wid,
      num: [],
      item: [],
    }
  },
  mounted() {
    this.loading = false
  },
  methods: {
    // 获取宠物信息
    async getWash() {
      const data = await getWash()
      this.item = data.data.message
      data.data.message.forEach(item => {
        if (item.wid == this.wid) {
          this.num.push(item)
        }
      })
      this.num = this.num[0]
      console.log('1111111111', this.num)
    },
  },
  mounted() {
    this.getWash()
  },
}
</script>

<style lang="scss" scoped>
.van-nav-bar {
  ::v-deep .van-icon {
    color: black;
  }
  ::v-deep .van-nav-bar__title {
    font-weight: bold;
    font-family: '黑体';
  }
}
::v-deep .van-nav-bar .van-icon {
  color: black;
}
#app p {
  margin: 0;
  padding: 0;
}
#app .cont {
  width: 300px;
  margin: auto;
  > .xian {
    margin: 5px 0;
    height: 3px;
    background-color: #f5f2f2;
  }

  > img {
    width: 300px;
    height: 180px;
    border-radius: 20px;
    // margin-top: 20px;
  }
  > .title {
    width: 200px;
    height: 30px;
    line-height: 30px;
    // background-color: #fce89d;
    // color: white;
    border-radius: 10px;
    font-size: 17px;
    font-weight: bold;
  }
  > .xm {
    > p:first-child {
      font-size: 17px;
      font-weight: bold;
    }
    > p:last-child {
      font-size: 16px;
      color: #a19e9e;
    }
  }
  > .price {
    padding: 10px 0;
    font-size: 17px;
    > span:first-child {
      display: inline-block;
      // background-color: rgb(95, 167, 95);
      color: rgb(255, 255, 255);
      padding: 0 2px;
    }
    > span:last-child {
      color: #e36f82;
      font-size: 23px;
      font-weight: bold;
    }
  }
}

// 服务对象
.sp {
  font-size: 16px;
  display: inline-block;
  width: 40px;
  height: 22px;
  background-color: #f6d8dd;
  text-align: center;
  border-radius: 20px;
  margin-top: 5px;
  color: #a19e9e;
}
.img2 {
  width: 160px;
  height: 150px;
}
.cy {
  width: 160px;
  text-align: center;
  font-size: 17px;
  font-weight: bold;

  color: #df7e8e;
}
</style>
